<include file="Public:header" />
<link href="__PUBLIC__/Index/css/style.css" rel="stylesheet" type="text/css" />
<script charset="utf-8" src="__PUBLIC__/kindeditor/kindeditor.js"></script>
<script>
		KE.show({
		id : "description_info",
		newlineTag:"br",
		afterChange : function(id) {
		KE.util.setData("description_info");
		}
		});
		
		KE.show({
		id : "description_img",
		newlineTag:"br",
		afterChange : function(id) {
		KE.util.setData("description_img");
		}
		});	
		
		KE.show({
		id : "description_map",
		newlineTag:"br",
		afterChange : function(id) {
		KE.util.setData("description_map");
		}
		});

		KE.show({
		id : "summary_info",
		newlineTag:"br",
		afterChange : function(id) {
		KE.util.setData("summary_info");
		}
		});

		KE.show({
		id : "nearby",
		newlineTag:"br",
		afterChange : function(id) {
		KE.util.setData("nearby");
		}
		});
</script>
</head>

<body>

<div id="container">
  <div id="main"> 
    <div id="content"> 
      <div class="weizhi"><span>当前位置：添加房源</span></div>
      <form action="" method="POST" enctype="multipart/form-data">
		<br>
		<span style="color:red">楼盘名称:</span><input type="text" name="name" value=""><br/>
		<span style="color:red">展示图片:</span><input type="file" name="img" value=""><br/>
		<span style="color:red">楼盘位置:</span><input type="text" name="location" value=""><br/>
		<span style="color:red">所 属  区:</span>
		<select name="quyu">
		<volist name="area" id="vo">
		<option value="<{$vo.a_id}>"><{$vo.a_name}></option>
		</volist>
		</select><br/>
		<span style="color:red">所属商圈:</span>
		<select name="district">
		<volist name="district" id="vo">
			<option value="<{$vo.d_id}>"><{$vo.d_name}></option>
		</volist>
		</select>
		<br>
		<span style="color:red">所属地铁线:</span>
		<select name="subway">
				<option value="1">1号线</option>
				<option value="2">2号线</option>
				<option value="4">4号线</option>
				<option value="5">5号线</option>
				<option value="8">8号线</option>
				<option value="9">9号线</option>
				<option value="10">10号线</option>
				<option value="13">13号线</option>
				<option value="15">15号线</option>
				<option value="batong">八通线</option>
				<option value="changpin">昌平线</option>
				<option value="fangshang">房山线</option>
				<option value="changpin">机场快轨</option>
				<option value="yizhuang">亦庄线</option>
			
			</select><br>
		<span style="color:red">所属地铁站:</span>
		<select name="subway_station">
			<volist name="ditie" id="vo">
				<option value="<{$vo.s_id}>"><{$vo.s_name}></option>
			</volist>
		</select><br>
		<span style="color:red">租赁方式:</span>
		<select name="zulin">
			<volist name="rent" id="vo">
				<option value="<{$vo.r_id}>"><{$vo.r_name}></option>
			</volist>
		</select><br>
		<span style="color:red">开发商:</span>
		<input type="text" name="developers" value=""><br>
		<span style="color:red">单价:</span>
		<input type="text" name="sell" value=""><span style="color:red">/平米</span><br>
		<span style="color:red">总价:</span>
		<input type="text" name="zongjia" value=""><span style="color:red">万元</span><br>
		<span style="color:red">日租金:</span>
		<input type="text" name="d_rent" value=""><span style="color:red">/平米</span><br>
		<span style="color:red">月租金:</span>
		<input type="text" name="m_rent" value=""><span style="color:red">/月</span><br>
		<span style="color:red">建筑面积:</span>
		<input type="text" name="build_area" value=""><span style="color:red">平米</span><br>
		<span style="color:red">使用面积:</span>
		<input type="text" name="use_area" value=""><span style="color:red">平米</span><br>
		<span style="color:red">详细标题:</span>
		<input type="text" name="title" value="">	<br>
		<span style="color:red">所在楼层:</span>
		<input type="text" name="floor" value="">	<br>
		<span style="color:red">装修状况:</span>
		<input type="text" name="decoration" value=""><br>
		<span style="color:red">楼盘等级:</span>
		<input type="text" name="rating" value=""><br>
		<span style="color:red">支付方式:</span>
		<input type="text" name="pay_type" value=""><br>
		<span style="color:red">配套设施:</span>
		<input type="text" name="supproting" value="">	<br>
		<span style="color:red">房源描述:</span>
		<textarea cols='100' rows='20' name='description_info' id='description_info'></textarea>
		<span style="color:red">图片描述:</span>
		<textarea cols='100' rows='20' name='description_img' id='description_img'></textarea>
		<span style="color:red">地图交通:</span>
		<textarea cols='100' rows='20' name='description_map' id='description_map'></textarea>
		
		<span style="color:red">楼盘简介:</span>
		<textarea cols='100' rows='20' name='summary_info' id='summary_info'></textarea>
		<span style="color:red">周边设施:</span>
		<textarea cols='100' rows='20' name='nearby' id='nearby'></textarea><br>
		</select>
		<span style="color:red">类型:</span>
		<select name="housetype">
		<option value="1">别墅</option>
		<option value="2">写字楼</option>
		<option value="3">商铺</option>
		<option value="4">公寓</option>
		<option value="5">整租整售</option>
		<option value="6">业主房源</option>
		</select>
		<input type="submit" name="sub" value="添加" onclick="return checkData()">
	  </form>



	</div>
	</div>
</div>
</body>
<script>
	function checkData()
	{
		if(obj('name').val() == '')
		{
			alert('楼盘名称不能为空');
			focus('name');
			return false;
		}
		if(obj('img').val() == '')
		{
			alert('必须上传图片');
			focus('img');
			return false;
		}
		if(obj('location').val() == '')
		{
			alert('楼盘地址不能为空');
			focus('location');
			return false;
		}
		if(obj('developers').val() == '')
		{
			alert('开发商不能为空');
			focus('developers');
			return false;
		}
		if(obj('zongjia').val() == '')
		{
			alert('总价不能为空');
			focus('zongjia');
			return false;
		}
		if(isNaN(obj('zongjia').val()))
		{
			alert('总价必须是数字');
			focus('hope_area');
			return false;
		}
		if(obj('d_rent').val() == '')
		{
			alert('日租金不能为空');
			focus('d_rent');
			return false;
		}
		if(isNaN(obj('d_rent').val()))
		{
			alert('日租金必须是数字');
			focus('d_rent');
			return false;
		}
		if(obj('m_rent').val() == '')
		{
			alert('月租金不能为空');
			focus('m_rent');
			return false;
		}
		if(isNaN(obj('m_rent').val()))
		{
			alert('月租金必须是数字');
			focus('m_rent');
			return false;
		}
		if(obj('build_area').val() == '')
		{
			alert('面积不能为空');
			focus('build_area');
			return false;
		}
		if(isNaN(obj('build_area').val()))
		{
			alert('面积必须是数字');
			focus('build_area');
			return false;
		}
		if(obj('use_area').val() == '')
		{
			alert('使用面积不能为空');
			focus('use_area');
			return false;
		}
		if(isNaN(obj('use_area').val()))
		{
			alert('使用面积必须是数字');
			focus('use_area');
			return false;
		}
		if(obj('title').val() == '')
		{
			alert('面积不能为空');
			focus('title');
			return false;
		}
		if(obj('floor').val() == '')
		{
			alert('所在楼层不能为空');
			focus('floor');
			return false;
		}
		if(isNaN(obj('floor').val()))
		{
			alert('所在楼层必须是数字');
			focus('floor');
			return false;
		}
	}

	function obj(obj)
	{
		return $("input[name='"+obj+"']");
	}
	function focus(o)
	{
		obj(o).val('');
		obj(o).focus();
	}
	

</script>
</html>





